package cn.lovemmd.bms.service.Impl;

import cn.lovemmd.bms.mapper.CodeMapper;
import cn.lovemmd.bms.pojo.Code;
import cn.lovemmd.bms.service.CodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class CodeServiceImpl implements CodeService {
    private final CodeMapper codeMapper;

    @Autowired
    public CodeServiceImpl(CodeMapper codeMapper) {
        this.codeMapper = codeMapper;
    }

    @Override
    public void useCode(String code) {
        codeMapper.useCode(code);
    }

    @Override
    public Code getCode(String code) {
        return codeMapper.getCode(code);
    }

    @Override
    public Integer addCode(String code, String authority) {
        return codeMapper.addCode(code, authority);
    }

    @Override
    public Integer deleteCode(String code) {

        return codeMapper.deleteCode(code);
    }
}
